<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="alert alert-warning-light">
                1. 自定义菜单最多包括3个一级菜单，每个一级菜单最多包含5个二级菜单。<br/>
                2. 一级菜单最多4个汉字，二级菜单最多7个汉字，多出来的部分将会以“...”代替
               
                <button style="position: absolute;top: 50px;right: 60px;" data-href="{:url('scmenu')}" class="btn btn-primary btn-sm submit-ajax" type="button" >确定发布</button>
            </div>
                <div class="widget-body no-padding">
                    <div class="wx-menu">
                        <!--left-->
                            <div style="width: 318px;float: left;height: 580px">
                                <div class="menu_preview_area">
                                    <div class="wx-mobile-head">{$currentWechatName}</div>
                                    <div class="mobile_bd">
                                        <ul class="pre_menu_list"> 
                                            <?php if($menu_list):?>
                                            <?php foreach($menu_list as $m):?>
                                            <li class="menu_item size1of{$class_index} nume-action" data-aid="{$m['menu_id']}" data-pid="0">
                                                <a class="pre_menu_link">{$m['menu_name']}</a>
                                                <!--二级菜单-->
                                                <div class="sub_pre_menu_box hide"><!-- 限制二级菜单数量的添加 -->
                                                    <ul class="sub_pre_menu_list">
                                                        <?php if(isset($m['child']) && is_array($m['child'])):?>
                                                        <?php foreach($m['child'] as $su):?>
                                                            <li class="jsSubMenu nume-action" data-aid="{$su['menu_id']}" data-pid="{$m['menu_id']}" data-subindex="3" style="">
                                                                <a href="javascript:void(0);" class="nume-active" title="最多添加5个子菜单">
                                                                    <span class="sub_pre_menu_inner">
                                                                       {$su['menu_name']}
                                                                    </span>
                                                                </a>
                                                            </li>     
                                                        <?php endforeach;?> 
                                                        <?php endif;?>  
                                                        <?php if(empty($m['child']) || $m['child_count'] < 5):?>              
                                                        <li class="jsSubMenu nume-action menu_add" data-pid="{$m['menu_id']}" data-aid="0" data-subindex="{$m['menu_id']}" style="">
                                                            <a href="javascript:void(0);" title="最多添加5个子菜单">
                                                                <span class="sub_pre_menu_inner">
                                                                    <i class="icon14_menu_add" style="background-position: 0 0;"></i>
                                                                </span>
                                                            </a>
                                                        </li>
                                                        <?php endif;?>  
                                                    </ul>
                                                    <i class="arrow arrow_out"></i>
                                                    <i class="arrow arrow_in"></i>
                                                </div>
                                                 <!--二级菜单 end-->
                                            </li>
                                            <?php endforeach;?>
                                            <?php endif;?>
                                            <?php if(count($menu_list) < 3):?>
                                            <li class="menu_item size1of{$class_index} nume-action menu_add" data-pid="0" data-aid="0">
                                                <a class="pre_menu_link"><i class="icon14_menu_add"></i></a>
                                            </li>
                                            <?php endif;?>
                                        </ul>
                                    </div>
                                </div>
                                 <div class="clearfix"></div>
                                <div style="text-align: center;margin-top:15px;">
                                    <!-- <button data-href="{:url('scmenu')}" class="btn btn-primary btn-sm submit-ajax" type="button" >确定发布</button> -->
                                     <button data-href="{:url('synch',['action'=>'menu'])}" class="btn btn-primary btn-sm submit-synch"><i class="fa fa-refresh"></i> 同步至</button>
                                </div>
                            </div>
                        <!--left-->
                        <!--right-->
                        <div class="menu_form_area">
                            <form id="nume-form" role="form" method="post" class="" action="{:url('updateweixinmenuname')}">
                                <div class="portable_editor">
                                    <input value="0" type="hidden" name="menu_id" id="_menu_id"/>
                                    <div class="editor_inner">
                                        <div class="clearfix"></div>
                                        <div class="col-sm-12">
                                            <div class="menu_form_head">
                                                <div class="row">
                                                    <div class="col-sm-6">
                                                        <label id="wx-name-label">新增菜单</label>
                                                    </div>
                                                    <div class="col-sm-6 text-right">
                                                        <a href="#" id="_delNume" class="delete confirm" data-rel="确定删除菜单吗?" data-action="" data-href="{:url('deleteWeixinMenu')}" >删除菜单</a>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </div>
                                            <div>
                                                <div class="form-group" style="margin-top: 35px;">
                                                    <label class="col-sm-12 control-label no-padding-right" style="text-align: left;" for="form-field-1"> 菜单名称 </label>

                                                    <div class="col-sm-12">
                                                        <input class="form-control col-xs-10 col-sm-5" name="menu_name" id="field-menu-name" type="text" placeholder="">
                                                        <div class="help-inline ">
                                                            <span class="middle">字数不超过4个汉字或8个字母</span>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="clearfix"></div>
                                                <div class="form-group" style="margin-top: 55px;">
                                                    <!-- <label class="col-sm-12 control-label no-padding-right text-left" for="form-field-1">  </label> -->

                                                    <div class="col-sm-12" style="position: relative;top: 5px;">
                                                        <label for="radio-2"><input type="radio" checked="" value="2" name="menu_event_type" id="radio-2"> 发送消息</label>　
                                                       <label for="radio-1"><input type="radio"  value="1" name="menu_event_type" id="radio-1"> 跳转网页</label>　
                                                       <label for="radio-3"><input type="radio"  value="3" name="menu_event_type" id="radio-3"> 跳转小程序</label>
                                                    </div>
                                                </div>
                                                

                                            </div>
                                            <div class="clearfix"></div>
                                            <div class="col-sm-12 menu-type menu-type-1" style="display: none;">
                                                <div class="form-box clearfix">
                                                    <p style="padding: 15px;color: #777;" >订阅者点击该子菜单会跳到以下链接</p>
                                                   <div class="form-group" style="margin-top: 15px;">
                                                        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 地址 </label>
                                                        <div class="col-sm-11">
                                                            <input class="col-xs-10 col-sm-7" name="menu_event_url" id="menu_event_url" type="text" placeholder="页面地址 http(s)://">
                                                            
                                                        </div>
                                                    </div>
                                               </div>
                                            </div>
                                            <div class="col-sm-12 menu-type menu-type-2" style="display: ;">
                                                <div class="form-box clearfix" style="height: auto;">
                                                    <p style="padding: 15px 0 0 0;color: #777;" >订阅者点击该子菜单会在微信客户端推送消息</p>
                                                   <div class="form-group" style="margin-top: 15px;width: 95%;">
                                                        <p>
                                                            <input type="radio" name="row[type]" value="text" checked=""> 文字　
                                                            <input type="radio" name="row[type]" value="image"> 图片　
                                                            <input type="radio" name="row[type]" value="mpnews" data-href="{:url('material/item')}"> 图文
                                                        </p>
                                                        <!--文字内容-->
                                                        <div class="_content content-text">
                                                            <textarea id="c-content" class="form-control simple-editor" name="row[content]"></textarea>
                                                        </div>
                                                        <!--图片内容-->
                                                        <div class="_content content-image" style="display: none">
                                                            <div class="input-group">
                                                                <input id="c-image" class="form-control" size="35" name="row[image]" type="text" value="">
                                                                <input type="hidden" id="_media_id" name="row[media_id]" value="" >
                                                                <div class="input-group-addon no-border no-padding">
                                                                    <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg,image/bmp" data-url="{:url('ajax/wxupload')}" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                                                                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                                                                </div>
                                                                <span class="msg-box n-right"></span>
                                                            </div>
                                                            <ul class="row list-inline faupload-preview" id="p-image"></ul>
                                                        </div>
                                                        <!--图文内容-->
                                                        <div class="_content content-material content-mpnews " style="display: none">
                                                        </div>
                                                    </div>
                                               </div>
                                            </div>
                                            <div class="col-sm-12 menu-type menu-type-3" style="display: none;">
                                                <div class="form-box clearfix" style="height: auto;min-height: 300px;">
                                                    <p style="padding: 15px;color: #777;" >
                                                    1.订阅者点击该子菜单会跳到关联的小程序。<br/>
                                                    2.必须是公众号关联的小程序APP ID。 <a href="/index/article/show?id=1" target="_blank">详情</a>
                                                </p>
                                                    <label class="col-sm-11 control-label no-padding-right" for="form-field-1"> 小程序 APP ID </label>
                                                    <div class="col-sm-11">
                                                        <input class="col-xs-10 col-sm-7" name="row[appid]" id="_appid" type="text" placeholder="小程序 APP ID">
                                                        <div class="clearfix"></div>
                                                        <br/>
                                                    </div>
                                                    <label class="col-sm-11 control-label no-padding-right" for="form-field-1"> URL </label>
                                                    <div class="col-sm-11">
                                                        <input class="col-xs-10 col-sm-7" name="row[url]" id="_url" type="text" placeholder="URL">
                                                        <div class="clearfix"></div>
                                                        <br/>
                                                    </div>
                                                    <label class="col-sm-11 control-label no-padding-right" for="form-field-1"> 默认页面 </label>
                                                    <div class="col-sm-11">
                                                        <input class="col-xs-10 col-sm-7" name="row[path]" id="_path" type="text" placeholder="pages/lunar/index">
                                                        <div class="clearfix"></div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="clearfix"></div>
                                        </div>
                                    <div class="clearfix"></div>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                                <!--right end-->
                                <div class="col-sm-12 m15 text-center" style="margin:25px 0;">
                                    <button class="btn btn-success btn-sm submit-ajax disabled submit-ajaxs"  data-form="#nume-form" type="button" >确定保存</button>
                                </div>
                            </form>
                        </div>
                        
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>